<template>
  <div class="question">
    <div v-if="questionType=='0'||questionType=='1'||questionType=='11'" >
      <span class="q-title" v-html="question.title"/>
      <span class="q-title">({{question.score}}分)</span>
      <div class="q-content">
          <span :key="index" v-for="(option,index) in question.options" class="q-item-contain">
            <span class="q-option-seqCode">
              <el-checkbox v-model="option.answerFlag">{{option.seqCode+'、'}}</el-checkbox >
            </span>
            <span v-html="option.content" class="q-option-content"></span>
            <br/>
          </span>
      </div>
      <div>
        <el-form-item label="答案:">
            <span :key="index" v-for="(option,index) in question.options" class="q-item-contain">
              <span class="q-option-seqCode" v-if="option.answerFlag==true">{{option.seqCode+' '}}</span>
            </span>
        </el-form-item>
      </div>
    </div>
    <div v-else-if="questionType>='2'&&questionType<='6'" >
      <span class="q-title" v-html="question.title"/>
      <span class="q-title">({{question.score}}分)</span>
      <div>
        <el-form-item label="答案:">
            <span :key="index" v-for="(answer,index) in question.answers" class="q-item-contain">
              <span class="q-option-seqCode">{{(index+1)+'、'}}</span>
              <span>
                <el-input type="textarea" v-model="answer.examineeAnswer" class="question-option-content-input"/>
                <br/>
              </span>
              <br/>
            </span>
        </el-form-item>
      </div>
    </div>
    <div v-else-if="questionType=='7'" >
      <div class="q-content">
          <span :key="index" v-for="(option,index) in question.options" class="q-item-contain">
            <span class="q-option-seqCode">{{option.seqCode+'、'}}</span>
            <span v-html="option.content" class="q-option-content"></span>
            <br/>
          </span>
      </div>
      <div  :key="index"  v-for="(choice,index) in question.choices">
        {{(index+1)+'：'}}<span class="question-sub-title" v-html="choice.title"/>
        <span class="q-title">({{choice.score}}分)</span>
        <el-form-item label="答案:">
          <span class="q-option-seqCode">
            <el-radio-group v-model="choice.examineeAnswer">
              <el-radio v-for="option in question.options" :key="option.seqCode" :label="option.seqCode">{{option.seqCode}}</el-radio>
            </el-radio-group>
          </span>
        </el-form-item>
      </div>
    </div>
    <div v-else-if="questionType=='8'||questionType=='9'" >
      <span class="q-title" v-html="question.title"/>
      <span class="q-title">({{question.score}}分)</span>
      <div class="q-content" :key="index"  v-for="(subQuestion,index) in question.questions" >
          <div>
            {{(index+1)+'：'}}<span class="question-sub-title" v-html="subQuestion.title"/>
            <span class="q-title">({{subQuestion.score}}分)</span>
            <br/>
            <span  class="q-item-contain" :key="option.seqCode"  v-for="option in subQuestion.options" >
              <span class="q-option-seqCode">
                <el-checkbox v-model="option.answerFlag">{{option.seqCode+'、'}}</el-checkbox >
              </span>
              <span v-html="option.content" class="q-option-content"></span>
              <br/>
            </span>
          </div>
          <div>
            <el-form-item label="答案:">
                <span :key="index" v-for="(option,index) in subQuestion.options" class="q-item-contain">
                  <span class="q-option-seqCode" v-if="option.answerFlag==true">{{option.seqCode+' '}}</span>
                </span>
            </el-form-item>
          </div>
      </div>
    </div>
    <div v-else-if="questionType=='10'" >
      <span class="q-title" v-html="question.title"/>
      <span class="q-title">({{question.score}}分)</span>
      <div>
        <el-form-item label="答案" >
              <el-radio-group v-model="question.answerFlag">
                <el-radio label="1">是</el-radio>
                <el-radio label="0">否</el-radio>
              </el-radio-group>
        </el-form-item>
      </div>
    </div>
  </div>

</template>

<script>
export default {
  name: 'examQuestion',
  props: {
    question: {
      type: Object,
      default: function () {
        return {}
      }
    },
    questionType: {
      type: String,
      default: 0
    }
  },
  methods: {
  }
}
</script>
